package pers.vic.quartz.constant;

/**
 * @description: 任务状态/动作
 * @author Vic.xu
 * @date: 2022-04-13
 */
public enum QuartzStatusEnum {

    /**
     * 运行
     */
    working(1, "运行"),
    /**
     * 暂停
     */
    pause(2, "暂停"),
    /**
     * 删除
     */
    remove(0, "删除");

    QuartzStatusEnum(int status, String text) {
        this.status = status;
        this.text = text;
    }

    public static QuartzStatusEnum getByStatus(Integer status) {
        for (QuartzStatusEnum statusEnum : QuartzStatusEnum.values()) {
            if (statusEnum.getStatus() == status) {
                return statusEnum;
            }
        }
        return null;
    }

    /**
     * 状态码
     */
    private int status;

    /**
     * 说明
     */
    private String text;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
